home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 017a / binutils.arj / MAKEFILE < prev    next >
Text File  |  1991-03-27  |  6KB  |  158 lines

  1. # Makefile for GNU binary-file utilities
  2. # select a set of CFLAGS and PROGS, below, depending on the system type
  3. # Copyright (C) 1989, Free Software Foundation, Inc.
  4. #
  5. # This file is part of the GNU binutils.
  6. # The GNU binutils are free software; you can redistribute them and/or modify
  7. # them under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. # The GNU binutils are distributed in the hope that they will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with the GNU binutils; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. GNUCC = gcc -O
  20. bindir=/usr/local/bin
  21.  
  22. # GNUDOS: use these
  23. CFLAGS = -O -DGNUDOS
  24. PROGS = ld size nm strip ar objdump
  25. CC = gcc
  26. .c.o:
  27.     $(CC) $(CFLAGS) -c $*.c
  28.  
  29. # for BSD systems
  30. #CFLAGS = -g
  31. # Don't add robotussin; it won't compile on BSD or GNU systems.
  32. # objdump is not here because it (at least used to) not compile
  33. # on most systems (trouble with N_DATADDR).  I've fixed some of
  34. # those problems, though.
  35. #PROGS = $(archpfx)gprof $(archpfx)ld $(archpfx)size \
  36. #        $(archpfx)nm $(archpfx)strip $(archpfx)ar $(archpfx)ranlib
  37.  
  38. # for USG systems using COFF_ENCAPSULATE
  39. # also, you will want to make the target libc.a (but it takes a long time)
  40. # Note that you should leave a copy of `ar' in this directory
  41. # after you install it, since `ranlib' will try to run it from here.
  42. #CFLAGS = -g -DUSG -DCOFF_ENCAPSULATE -DPORTAR -DNON_NATIVE -DPIGNAL_MISSING
  43. #PROGS = ld size nm strip ar robotussin objdump ranlib gprof
  44. #SIGNAME = signame.o
  45. # On ALTOS systems, add -DALTOS to CFLAGS.
  46.  
  47. #it's better to move a copy of alloca into your libc than to risk getting some
  48. #incompatiable functions from -lPW (like index()), but if you
  49. #want to be lazy, uncomment this line
  50. #ALLOCALIBS = -lPW
  51.  
  52. # For HP-UX systems
  53. # Don't add robotussin; use hpxt instead.
  54. # Note that you should leave a copy of `ar' in this directory
  55. # after you install it, since `ranlib' will try to run it from here.
  56. #CFLAGS = -g -Ihp-include -DUSG -DNON_NATIVE
  57. #PROGS = ld size nm strip ar ranlib
  58. #ALLOCALIBS = alloca.o
  59.  
  60. # For the NeXT:
  61. # Set GNUCC = cc
  62. # Add -DHAVE_VPRINTF -DMACH_O to CFLAGS.
  63. # Comment out MALLOC below to use the system's malloc().
  64.  
  65. # Sun386:
  66. # After applying these diffs, compile with -DPORTAR -DCOFF_ENCAPSULATE
  67. # Depending on how you configure gcc, you might also want -Dnounderscore,
  68. # though I did not wind up using it.
  69.  
  70. # If you run out of stack space while running GNU ar or GNU ld (this
  71. # manifests itself as a segment violation), you should link in alloca.c
  72. # from the gcc sources, and get rid of the "#define alloca" in ar.c and
  73. # ld.c; or you could try to get Sun to fix this annoying "feature".
  74. #CFLAGS = -g -DCOFF_ENCAPSULATE -DPORTAR
  75. #PROGS = ld size nm strip ar robotussin objdump ranlib gprof
  76.  
  77. # nm tries to malloc enough space for the string table.  The old GNU malloc
  78. # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might 
  79. # fail unnecessarily.  I've also seen some unix malloc's fail, even when
  80. # there is enough memory.  So use the new GNU malloc.
  81. # GNUDOS: we already have it
  82. # MALLOC = $(archpfx)gmalloc.o
  83.  
  84. GNU_GETOPT = $(archpfx)getopt.o
  85. GNU_GETOPT_LONG = $(archpfx)getopt.o $(archpfx)getopt1.o
  86.  
  87. # C++ demangler
  88. CPLUS_DEM = $(archpfx)cplus-dem.o
  89.  
  90. LIBS=$(ALLOCALIBS) $(SIGNAME)
  91.  
  92. all: $(PROGS)
  93.  
  94. $(archpfx)ld: $(archpfx)ld.o $(GNU_GETOPT_LONG) $(CPLUS_DEM)
  95. # LIBS is used here since ld needs to use alloca.
  96. # Alternatively, compile it with GNU C--then the compiler handles alloca.
  97.     $(CC) $(CFLAGS) -o $(archpfx)ld $(archpfx)ld.o $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS)
  98.  
  99. $(archpfx)size: $(archpfx)size.o
  100.     $(CC) $(CFLAGS) -o $(archpfx)size $(archpfx)size.o
  101.  
  102. $(archpfx)nm: $(archpfx)nm.o $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(MALLOC)
  103.     $(CC) $(CFLAGS) -o $(archpfx)nm $(archpfx)nm.o \
  104.         $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS) $(MALLOC)
  105.  
  106. $(archpfx)strip: $(archpfx)strip.o $(GNU_GETOPT_LONG)
  107.     $(CC) $(CFLAGS) -o $(archpfx)strip $(archpfx)strip.o $(GNU_GETOPT_LONG) $(LIBS)
  108.  
  109. $(archpfx)ar: $(archpfx)ar.o
  110.     $(CC) $(CFLAGS) -o $(archpfx)ar $(archpfx)ar.o $(LIBS)
  111.  
  112. $(archpfx)gprof: $(archpfx)gprof.o $(GNU_GETOPT_LONG) $(CPLUS_DEM)
  113.     $(GNUCC) $(CFLAGS) -o $(archpfx)gprof $(archpfx)gprof.o \
  114.         $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS)
  115. $(archpfx)gprof.o: gprof.c gmon.h 
  116.     $(GNUCC) $(CFLAGS) -c gprof.c $(OUTPUT_OPTION)
  117.  
  118. $(archpfx)ranlib: $(archpfx)ranlib.o $(GNU_GETOPT_LONG)
  119.     $(CC) $(CFLAGS) -o $(archpfx)ranlib $(archpfx)ranlib.o $(GNU_GETOPT_LONG) $(LIBS)
  120. $(archpfx)ranlib.o: ranlib.c
  121.     $(CC) -c $(CFLAGS) -DAR_PROG=\"$(bindir)/ar\" ranlib.c $(OUTPUT_OPTION)
  122.  
  123. $(archpfx)objdump: $(archpfx)objdump.o $(GNU_GETOPT_LONG) aoutgnu.h
  124.     $(CC) $(CFLAGS) -o $(archpfx)objdump $(archpfx)objdump.o \
  125.         $(GNU_GETOPT_LONG) $(LIBS)
  126.  
  127. # Robotussin is NOT part of `all'.
  128. $(archpfx)robotussin: $(archpfx)robotussin.o
  129.     $(CC) $(CFLAGS) -o $(archpfx)robotussin $(archpfx)robotussin.o
  130.  
  131. libc.a: $(archpfx)robotussin libconvert $(archpfx)ar
  132.     libconvert /lib/libc.a libc.a
  133.  
  134. # usg-gnulib is the file gcc makes using the usg compiler
  135. gnulib: $(archpfx)robotussin libconvert usg-gnulib $(archpfx)ar
  136.     libconvert usg-gnulib gnulib
  137.  
  138. clean:
  139.     -rm -f *.o core
  140.     -rm -f $(archpfx)*.o
  141.     -rm -f $(PROGS)
  142.  
  143. dist: binutils.tar.Z
  144.  
  145. # Requires GNU tar.
  146. binutils.tar.Z:
  147.     cd ..; tar -cohz -f binutils/binutils.tar.Z -T binutils/ARCHLIST
  148.  
  149. .PHONY: install
  150. install: $(PROGS)
  151.     for file in $(PROGS); do \
  152.     cp $$file $(bindir)/$${file}.new; \
  153.     mv $(bindir)/$${file}.new $(bindir)/$$file; \
  154.     done
  155.